	#include "boot.h"

  	// 16位代码，务必加上
  	.code16
 	.text
	.global _start
_start:

    xor %eax,   %eax
	mov %ax,	%ds
	mov %ax,	%ss
	mov %ax,	%es
	mov %ax,	%fs
	mov %ax,	%gs	


    mov $_start, %esp

	mov $0xe,	%ah
	mov $'B',	%al
	int	$0x10


    mov $0xe,	%ah
	mov $'O',	%al
	int	$0x10

	mov $0xe,	%ah
	mov $'O',	%al
	int	$0x10

	mov $0xe,	%ah
	mov $'T',	%al
	int	$0x10

reader_loader:
	mov	$0x8000,	%bx		//读取内存地址
	mov	$0x2,	%cx
	mov $0x2,	%ah
	mov $64,	%al
	mov $0x0080,	%dx		//dh: 磁头号，dl驱动器号0x80(磁盘1)
	int $0x13
	jc reader_loader

	//跳到c执行部分
	jmp boot_entry


	jmp .
	
	// 引导结束段
	.section boot_end, "ax"
boot_sig: .byte 0x55, 0xaa
